﻿Imports DTO
Imports System.Data.OleDb
Public Class CachDungDAO
    Public Shared Function LaytenCD() As List(Of CachDungDTO)
        Dim sql As String
        sql = "select * from CACHDUNG "
        Dim conn As OleDbConnection = Data_Provider.ConnecDTB()

        Dim command As OleDbCommand
        command = New OleDbCommand(sql, conn)

        Dim reader As OleDbDataReader = command.ExecuteReader()
        Dim ds_tenthuoc As New List(Of CachDungDTO)

        While reader.Read()
            Dim ts As New CachDungDTO()
            ts.CachDung = reader.GetString(1)
            ds_tenthuoc.Add(ts)
        End While

        Return ds_tenthuoc
    End Function
End Class
